package cytargetlinker.conversion.data;

import cytargetlinker.conversion.graph.Graph;
import cytargetlinker.conversion.graph.Graph.Edge;

public class TFGeneInteraction {
	private INode source;
	private INode target;
	private String score;
	private String pvalue;
	private String interactionClass = "TF-target";
	private String pubmedId;
	
	
	public TFGeneInteraction(INode source, INode target, String score, String pvalue, String pubmedId) {
		super();
		this.source = source;
		this.target = target;
		this.score = score;
		this.pvalue = pvalue;
		this.pubmedId = pubmedId;
		
	}
	
	public Edge createEdge(Graph graph, String datasource, int count) {
		Edge e = graph.addEdge("" + count, source.getNode(graph), target.getNode(graph));
		if(!score.equals("")) e.setAttribute("score", getScore().toString());
		if(!pvalue.equals("")) e.setAttribute("pValue", getPvalue());
		if(!pubmedId.equals("")) e.setAttribute("pubmedId", getPubmedId());
		e.setAttribute("interactionType", getInteractionClass());
		e.setAttribute("datasource", datasource);
		return e;
	}
	
	// SETTERS & GETTERS
	
	public INode getSource() {
		return source;
	}
	public INode getTarget() {
		return target;
	}
	public String getScore() {
		return score;
	}
	public String getInteractionClass() {
		return interactionClass;
	}
	public String getPvalue() {
		return pvalue;
	}
	public String getPubmedId() {
		return pubmedId;
	}
	
}
